//package oodAYLX;
//
//public class Test2 {
//    public static void main(String[] args) {
//        Dog[] dogs=new Dog[3];
//        dogs[0]=new Dog("小白",2,"黑");
//        dogs[1]=new Dog("小会",1,"灰");
//        dogs[2]=new Dog("小黄",3,"红");
//        System.out.println(dogs[0].name);
//        dogs[1].age=4;
//        dogs[2].swim();
//        for (int i=1;i<dogs.length;i++){
//            System.out.println(dogs[i].name);
//            dogs[i].eat(); //每只狗狗在吃饭
//            Chick[]chicks=new Chick[3];
//            chicks[0]=new Chick("小白",4, "黑色");
//            chicks[1]=new Chick("黄黄",3,"绿色");
//            chicks[2]=new Chick("白白",2,"紫色");
//            System.out.println(chicks[0].name);
//            chicks[1].age=4;
//            chicks[2].drink();
//            for (int a=1;a<chicks.length;a++){
//                System.out.println(chicks[a].name);
//                chicks[a].layEggs();
//            }
//        }
//    }
//}
